import request from '@/utils/request'
// 获取运营工单列表
export function getBusiness(params) {
  return request({
    url: `/api/task-service/task/search`,
    params
  })
}
// 获取工单状态
export function getzhuangtaiList() {
  return request({
    url: `/api/task-service/task/allTaskStatus`
  })
}
// 获取运维工单列表
export function getOperation(params) {
  return request({
    url: `/api/task-service/task/search`,
    params
  })
}

// 运维创建工单
export function addOperation(data) {
  return request({
    method: 'post',
    url: `/api/task-service/task/create`,
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

// 运维人员
export function getYunWeiRen(id) {
  return request({
    url: `/api/user-service/user/repairerList/${id}`
  })
}
// 工单类型列表
export function getGongdanList() {
  return request({
    url: `/api/task-service/taskType/list`,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 获取工单详情
export function getGongdanDesc(taskId, params) {
  return request({
    url: `/api/task-service/task/taskInfo/${taskId}`,
    headers: {
      'Content-Type': 'application/json'
    },
    params
  })
}

// 工单取消
export function getGongdanquxiao(taskId, data) {
  return request({
    method: 'post',
    url: `/api/task-service/task/cancel/${taskId}`,
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

// 补货详情
export function getBuhuoDesc(taskId, params) {
  return request({
    url: `/api/task-service/taskDetails/${taskId}`,
    headers: {
      'Content-Type': 'application/json'
    },
    params
  })
}
// 补货工单清单
export function getBuhuoqingdan(innerCode) {
  return request({
    url: `/api/vm-service/channel/channelList/${innerCode}`,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// 警戒值

export function getJingjiezhi() {
  return request({
    url: `/api/task-service/task/supplyAlertValue`,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// 设置工单警戒配置
export function getJingjieshezhi(data) {
  return request({
    method: 'post',
    url: `/api/task-service/task/autoSupplyConfig`,
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}
